refactor(bigframes): Simplify @udf wrapper object#16556
refactor(bigframes): Simplify @udf wrapper object#16556TrevorBergeron wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the User Defined Function (UDF) infrastructure by introducing a Udf protocol and a UdfRoutine dataclass, effectively consolidating the handling of BigQuery routines and removing the BigqueryCallableRowRoutine class. Code throughout the library now utilizes isinstance(..., Udf) for type checking. Furthermore, the system tests for managed functions have been significantly updated to use a pytest fixture for more reliable resource cleanup. Feedback was provided regarding the incorrect use of @functools.partial as a decorator on the UdfRoutine.__call__ method, which should be removed.
| if callable(condition): | ||
| # When it's a bigframes function. | ||
| if hasattr(condition, "bigframes_bigquery_function"): | ||
| if isinstance(condition, bigframes.functions.Udf): |
There was a problem hiding this comment.
I presume this is the reason for runtime_checkable above?
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕